package edu.sctu.wujiayi.month06.day20150628.javaText;

import java.io.IOException;

import static edu.sctu.wujiayi.month06.day20150628.javaText.SeraiPracticel.opSerial;
import static edu.sctu.wujiayi.month06.day20150628.javaText.SeraiPracticel.serail;

/**
 * Created by user11 on 2015/6/28.
 */
public class MainRun {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        FileOne fileOne = new FileOne();
        fileOne.fileDeal("D://Json//Json.txt");

        fileOne.soDealFile();

        ThreadOne threadOne = new ThreadOne();


        String json = threadOne.threadunit(UrlPath.URL_PATH);
        JsonUnitOne jsonUnitOne = new JsonUnitOne(json);
        JsonValueOne jsonValueOne = jsonUnitOne.jsonValueOne;
        for (int i = 0;i<jsonValueOne.list.size();i++){
            System.out.println(jsonValueOne.list.get(i).goods_id);

            System.out.println(jsonValueOne.list.get(i).goods_price);
        }

        AddGoods judementOne = new AddGoods();
        judementOne.judgmentGoods(jsonValueOne);
        System.out.println("价格大于100的商品有"+ judementOne.goodscount+"件");
        System.out.println("价格小于100的商品有"+ judementOne.goodscount2+"件");


        serail(jsonValueOne,"D://Json//Json.txt");
        JsonValueOne jsonValueOne1 = opSerial();
        System.out.println(jsonValueOne1.count);
    }
}
